<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>计划单管理</title>
		<link href="css/common.css" rel="stylesheet" type="text/css" />
		<link href="css/normolize.css" rel="stylesheet" type="text/css" />
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<!--[if IE 9]> <link href="css/ieHack9.css" rel="stylesheet" type="text/css" /> <![endif]-->
		<!--[if IE 8]> <link href="css/ieHack.css" rel="stylesheet" type="text/css" /><link href="css/ieHack8.css" rel="stylesheet" type="text/css" /> <![endif]-->
		<!--[if lte IE 7]> <link href="css/ieHack.css" rel="stylesheet" type="text/css" /> <![endif]-->
		<style>
			.planname:hover{text-decoration: underline;}
		</style>
	</head>

	<body>
		<script src="js/tpl/header.js" type="text/javascript" charset="utf-8"></script>
		<div class="page-wrapper productlist minwidth border" id="page-wrapper">
			<div class="line"></div>
			<script src="js/tpl/menu.js" type="text/javascript" charset="utf-8"></script>
			<div class="vertival-line"></div>
			<div class="page-content">
				<div class="tablist">
					<ul>
						<li class="tabItem active">
							<a href="planOrderManage.html#planOrder">喷码计划单</a>
						</li>
					</ul>
				</div>

				<div class="page-container">
					<div class="page-form">
						<div>
							<span class="btn disabled fl" id="groupSubmit">批量提交</span>
							<span class="btn blue addPro  fr"><i class="icon icon_add blue"></i> 添加计划单</span>
						</div>
						<div class="clearfix"></div>

						<div class="form">
							<form class="multiinline-form" id="searchForm">
								<section>
									<div>
										<label>计划单名称：</label>
										<input type="text" placeholder="请输入计划单名称" style="width: 160px;" />
									</div>

									<div>
										<label>计划单编号：</label>
										<input type="text" placeholder="请输入计划单编号" style="width: 160px;" />
									</div>

									<div>
										<label>产品名称：</label>
										<input type="text" placeholder="请输入产品名称" style="width: 160px;" />
									</div>
								</section>
								<br/>
								<div class="clearfix"></div>
								<section style="margin-top:14px;">
									<div>
										<label style="line-height: 26px;">状态：</label>
										<div class="overlay">
											<!--这个是用来存放选中的select的值的-->
											<input type="hidden" value="" class="form-select-value" />
											<div class="dropdown">
												<button class="dropdown-toggle form-dropdown" type="button">
				                                <span class="value">全部</span>
				                                <span class="caret"></span>
				                            </button>
												<ul class="none">
													<li data-value='001'>1</li>
													<li data-value='002'>2</li>
													<li data-value='003'>3</li>
													<li data-value='004'>4</li>
												</ul>
											</div>
										</div>
									</div>

									<div>
										<label>完成时间：</label>
										<input type="text" class="Wdate" onclick="WdatePicker()" />--<input type="text" class="Wdate" onclick="WdatePicker()" />
									</div>
									<input type="button" value="搜索" class="search-input-button" />
									<input type="button" value="重置" onclick="resetForm()" class="search-input-button bgblue" />
								</section>

							</form>
						</div>
					</div>
					<div class="table">
						<div class="tablelist">
							<table>
								<thead>
									<tr>
										<th class="colspan" style="width:130px;">
											<div class="checkbox inline-block">
												<input type="checkbox" value="" class="label-input" id="checkAll" />
												<label for="checkAll" class="input-label"></label>
											</div>
											全选
										</th>
										<th>计划单信息</th>
										<th>印码信息</th>
										<th>时间/状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody id="itemContainer">
									<tr>
										<td class="colspan" style="width:130px;">
											<div class="checkbox checked_checkbox inline-block" style="position:relative;z-index:10;">
												<input type="checkbox" checked="checked"  value="" class="label-input" id="checkbox_1" />
												<label for="checkbox_1" class="input-label"></label>
											</div>
											<img src="images/product/product.png" class="product"   onclick="showplanDetail(this)" />
										</td>
										<td onclick="showplanDetail(this)">
											<div class="inline-block vertical-middle text-left">
												<p class="">产品：<span class="text-ellipsis" style="width:150px;">山西汾酒</span></p>
												<p class="tabletop planname" data-id="1">计划单：<span class="text-ellipsis" style="width:150px;">五粮液第一批巴拉</span></p>
												<p class="tabletop">编号：2015426532562</p>
											</div>
										</td>
										<td onclick="showplanDetail(this)">
											<div  class="inline-block vertical-middle text-left">
												<p class="">厂商：<span class="text-ellipsis" style="width:150px;">山东丽鹏股份巴拉</span></p>
												<p class="tabletop">类型：瓶码/内外码</p>
												<p class="tabletop">数量：10000个</p>
											</div>
										</td>
										 
										<td  onclick="showplanDetail(this)">
											<div class="text-left" style="width:150px;margin:auto;">
												<p>状态：<span class="red">已完工</span></p>
												<p class="tabletop">创建：2016-8-10</p>
											    <p class="tabletop red">截止：2016-8-19</p>
											</div>
										</td>
										
										<td>
											<div class="text-left  inline-block" style="width:90px;margin-left: 16px;">
												<div class=" editPro hover"  data-id='1'><i class="icon icon_edit"></i> <span class="">修改</span></div>
												<div class="tabletop  deletePro hover"  data-id='1'><i class="icon icon_delete"></i> <span class="">删除</span></div>
												<div class="tabletop addPlanOrder hover"  data-id='1'><i class="icon icon_addPlan"></i> <span class="">提交</span></div>
											</div>
										</td>
									</tr>
									
									<tr>
										<td class="colspan" style="width:130px;" >
											<div class="checkbox inline-block">
												<input type="checkbox" value="" class="label-input" id="checkbox_2" />
												<label for="checkbox_2" class="input-label"></label>
											</div>
											<img src="images/product/product.png" class="product" onclick="showplanDetail(this)" />
										</td>
										<td  onclick="showplanDetail(this)">
											<div class="inline-block vertical-middle text-left">
												<p class="">产品：<span class="text-ellipsis" style="width:150px;">山西汾酒</span></p>
												<p class="tabletop planname" data-id='2'>计划单：<span class="text-ellipsis" style="width:150px;">五粮液第一批巴拉</span></p>
												<p class="tabletop">编号：2015426532562</p>
											</div>
										</td>
										<td  onclick="showplanDetail(this)">
											<div  class="inline-block vertical-middle text-left">
												<p class="">厂商：<span class="text-ellipsis" style="width:150px;">山东丽鹏股份巴拉</span></p>
												<p class="tabletop">类型：瓶码/内外码</p>
												<p class="tabletop">数量：10000个</p>
											</div>
										</td>
									  
										<td  onclick="showplanDetail(this)">
											<div class="text-left" style="width:150px;margin:auto;">
												<p>状态：<span>已完工</span></p>
												<p class="tabletop">创建：2016-8-10</p>
											    <p class="tabletop red">截止：2016-8-19</p>
											</div>
										</td>
										<td>
											<div class="text-left  inline-block" style="width:90px;margin-left: 16px;">
												<div class="detail hover" onclick="window.location.href='planOrderDetail.html'" data-id='2'><i class="icon icon_detail2"></i> <span>明细</span></div>
											</div>
										</td>
									</tr>
									
									<tr>
										<td class="colspan" style="width:130px;">
											<div class="checkbox inline-block">
												<input type="checkbox" value="" class="label-input" id="checkbox_3" />
												<label for="checkbox_3" class="input-label"></label>
											</div>
											<img src="images/product/product.png" class="product"   onclick="showplanDetail(this)"/>
										</td>
										<td  onclick="showplanDetail(this)">
											<div class="inline-block vertical-middle text-left">
												<p class="">产品：<span class="text-ellipsis" style="width:150px;">山西汾酒</span></p>
												<p class="tabletop planname" data-id='3'>计划单：<span class="text-ellipsis" style="width:150px;">五粮液第一批巴拉</span></p>
												<p class="tabletop">编号：2015426532562</p>
											</div>
										</td>
										<td  onclick="showplanDetail(this)">
											<div  class="inline-block vertical-middle text-left">
												<p class="">厂商：<span class="text-ellipsis" style="width:150px;">山东丽鹏股份巴拉</span></p>
												<p class="tabletop">类型：瓶码/内外码</p>
												<p class="tabletop">数量：10000个</p>
											</div>
										</td>
										<td  onclick="showplanDetail(this)">
											<div class="text-left" style="width:150px;margin:auto;">
												<p>状态：<span>已接单</span></p>
												<p class="tabletop">创建：2016-8-10</p>
											    <p class="tabletop red">截止：2016-8-19</p>
											</div>
										</td>
										<td>
											<div class="text-left  inline-block" style="width:90px;margin-left: 16px;">
												<div><span>工厂已接单</span></div>
											</div>
										</td>
									</tr>
									<tr>
										<td class="colspan" style="width:130px;" >
											<div class="checkbox inline-block">
												<input type="checkbox" value="" class="label-input" id="checkbox_4" />
												<label for="checkbox_4" class="input-label"></label>
											</div>
											<img src="images/product/product.png" class="product"  onclick="showplanDetail(this)"/>
										</td>
										<td  onclick="showplanDetail(this)">
											<div class="inline-block vertical-middle text-left">
												<p class="">产品：<span class="text-ellipsis" style="width:150px;">山西汾酒</span></p>
												<p class="tabletop planname" data-id='4'>计划单：<span class="text-ellipsis" style="width:150px;">五粮液第一批巴拉</span></p>
												<p class="tabletop">编号：2015426532562</p>
											</div>
										</td>
										<td  onclick="showplanDetail(this)">
											<div  class="inline-block vertical-middle text-left">
												<p class="">厂商：<span class="text-ellipsis" style="width:150px;">山东丽鹏股份巴拉</span></p>
												<p class="tabletop">类型：瓶码/内外码</p>
												<p class="tabletop">数量：10000个</p>
											</div>
										</td>
										 
										<td  onclick="showplanDetail(this)">
											<div class="text-left" style="width:150px;margin:auto;">
												<p>状态：<span>已提交</span></p>
												<p class="tabletop">创建：2016-8-10</p>
											    <p class="tabletop red">截止：2016-8-19</p>
											</div>
										</td>
										<td>
											<div class="text-left inline-block" style="width:90px;margin-left: 16px;">
												<div><span>等待工厂接单</span></div>
											</div>
										</td>
									</tr>
									
									<tr>
										<td class="colspan" style="width:130px;">
											<div class="checkbox inline-block">
												<input type="checkbox" value="" class="label-input" id="checkbox_5" />
												<label for="checkbox_5" class="input-label"></label>
											</div>
											<img src="images/product/product.png" class="product"   onclick="showplanDetail(this)"/>
										</td>
										<td  onclick="showplanDetail(this)">
											<div class="inline-block vertical-middle text-left">
												<p class="">产品：<span class="text-ellipsis" style="width:150px;">山西汾酒</span></p>
												<p class="tabletop planname" data-id='5'>计划单：<span class="text-ellipsis" style="width:150px;">五粮液第一批巴拉</span></p>
												<p class="tabletop">编号：2015426532562</p>
											</div>
										</td>
										<td  onclick="showplanDetail(this)">
											<div  class="inline-block vertical-middle text-left">
												<p class="">厂商：<span class="text-ellipsis" style="width:150px;">山东丽鹏股份巴拉</span></p>
												<p class="tabletop">类型：瓶码/内外码</p>
												<p class="tabletop">数量：10000个</p>
											</div>
										</td>
										<td  onclick="showplanDetail(this)">
											<div class="text-left" style="width:150px;margin:auto;">
												<p>状态：<span  class="red">驳回</span></p>
												<p class="tabletop">创建：2016-8-10</p>
												<p class="tabletop red">截止：2016-8-19</p>
											</div>
										</td>
										 
										<td>
											<div class="text-left inline-block" style="width:90px;margin-left: 16px;">
												<div class="editPro hover"  data-id='5'><i class="icon icon_edit"></i> <span class="">修改</span></div>
												<div class="tabletop bhreason hover"  data-id='5'><i class="icon icon_bh"></i> <span class="">驳回原因</span></div>
											</div>
										</td>
									</tr>
									
									
									
								</tbody>
							</table>
						</div>

						<div class="pagelist fr">
							<div class=" pagedesc fl">当前<span class="currentPage"></span>/<span class="totalpage"></span>，每页<span class="perpage"></span>条，共<span class="totalnumber"></span>条</div>
							<div class="pagination inline-block fl"></div>
							<div class="inline-block fl">
								到第<input type="text" value="" class="gotopage" />页 <input type="button" value="跳转" class="search-input-button border-radius bgblue gotopage_button"></span>
							</div>

						</div>

					</div>

				</div>

			</div>
		</div>

		<div class="footer">
			<div class="footercontainer">
				<ul>
					<li>
						<a href="#">关于我们</a>
					</li>
					<li>
						<a href="#">服务与支持</a>
					</li>
					<li>
						<a href="#">常见问题</a>
					</li>
					<li>
						<a href="#">人才招聘</a>
					</li>
					<li>
						<a href="#">加盟合作</a>
					</li>
				</ul>

				<div style="margin-top:13px;">版权所有@ 2015 - 2016 深圳在乎传媒科技有限公司 粤ICP备15107022-1号</div>
			</div>

		</div>

		<!--这里是删除产品的弹框（无法删除）-->

	</body>

	<script src="js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/page/jPages.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/js.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/page/pageFun.js" type="text/javascript" charset="utf-8"></script>

	<script src="js/wdatePicker/WdatePicker.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/layer/layer.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/layFun.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/scroll/jquery.slimscroll.min.js" type="text/javascript" charset="utf-8"></script>

	<script>
		
		//这个是产品详情
			function showplanDetail(obj){
				id=$(obj).find('.planname').attr('data-id'); //这是计划单的ID
				layObj.open('planinfo.html?id='+id,800,782,'计划单详情');
			}
			
			
		var id;
		$(function() {
			commonObj.init();
			var checkedLen;
			$('.tablelist input:checkbox').click(function(){
				checkedLen=$('.checkbox.checked_checkbox').length;
				if(checkedLen>0){
					$('#groupSubmit').removeClass('disabled');
				}else{
					$('#groupSubmit').addClass('disabled');
				}
			})
			
			
			 
				
			//这个是添加计划单
			$('.addPro').click(function() {
				layObj.open('addPlanorder.html',800,623,'添加计划单');
			})
			
			$('.editPro').click(function() {
				id=$(this).attr('data-id'); //这是计划单的ID
				layObj.open('addPlanorder.html?id='+id,800,623,'修改计划单');
			})
			
			//这个是删除计划单
			$('.deletePro').click(function() {
				id = $(this).attr('data-id');
				layObj.open('confirmDelete.html',400,180,'删除计划单',assignInfo);
			});
			
			//这个是驳回原因
			$('.bhreason').click(function() {
				id = $(this).attr('data-id');
				layObj.notice('noticeIframe.html',500,250,'驳回原因',assignReason);
				
			});
		 
		});
		
		
		//这里是弹框删除计划单
		function assignInfo(layero,index){
			var body = layer.getChildFrame('body', index);
			var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
			body.find('.title').html('是否删除计划单?');
			//给父页面传值
			body.find('#subButton').on('click', function() {
//				console.log("id "+ id);
				ajaxdeletePro(id);
				layer.close(index);
			});
			body.find("#cancelButton").on('click', function() {
				layer.close(index);
			});
		}
		//这个是ajax删除计划单
		function ajaxdeletePro(id){
			
		}
		
		function assignReason(layero,index){
			var body = layer.getChildFrame('body', index);
			var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
			var reason="因为蓝莲多的需哦啊呀呀哈哈啊我所以该产品已添加计划单，";
	
			body.find('.title').html('<i class="icon icon_bh" style="height: 19px;"></i><span class="colorblue">驳回原因</span><div style="display:table;width: 100%;"><div style="display:table-cell;width:100%;vertical-align:middle;height:150px;">'+reason+'</div></div>');
		}
	</script>

</html>